package com.cardmanager.pro.business;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.cardmanager.pro.pojo.ConsumeTaskPOJO;
import com.cardmanager.pro.pojo.RepaymentTaskPOJO;
import org.springframework.data.repository.query.Param;

public interface RepaymentTaskPOJOBusiness {
	List<Object[]> queryRepaymentTaskAllamountByUserIdAndCardno(String userId, String creditCardNumber);

	RepaymentTaskPOJO save(RepaymentTaskPOJO repaymentTaskPOJO);

	int queryTaskStatus0Count(String userIdStr, String creditCardNumber, int taskStatus);

	List<RepaymentTaskPOJO> findTaskType2AndTaskStatus0RepaymentTask();

	int queryTaskStatus0AndTaskType0Count(String userId, String creditCardNumber, int taskStatus, int taskType);

	int queryOrderStatus1AndTaskType0Count(String userId, String creditCardNumber, int orderStatus, int taskType);

	RepaymentTaskPOJO[] saveArray(RepaymentTaskPOJO[] repaymentTaskPOJOs);

	List<RepaymentTaskPOJO> findByTaskStatus0RepaymentTask(String userId, String creditCardNumber, Pageable pageable);

	List<RepaymentTaskPOJO> findByTaskStatus1AndOrderStatus0RepaymentTask(String userId, String creditCardNumber,
                                                                          Pageable pageable);

	List<RepaymentTaskPOJO> findByTaskStatus1AndOrderStatus1RepaymentTask(String userId, String creditCardNumber,
                                                                          Pageable pageable);

	List<RepaymentTaskPOJO> findByTaskStatus2AndOrderStatus1RepaymentTask(String userId, String creditCardNumber,
                                                                          Pageable pageable);

	List<RepaymentTaskPOJO> findByTaskStatus2AndOrderstatus0RepaymentTask(String userId, String creditCardNumber,
                                                                          Pageable pageable);

	List<RepaymentTaskPOJO> findByUserIdAndCreditCardNumber(String userId, String creditCardNumber, Pageable pageable);

	List<RepaymentTaskPOJO> findByUserIdAndCreditCardNumberAnAndChannelId( String userId, String creditCardNumber,String channelId);

	RepaymentTaskPOJO findByRepaymentTaskId(String repaymentTaskId);

	RepaymentTaskPOJO findByOrderCode(String orderCode);

	void updateTaskStatus4AndReturnMessageByRepaymentTaskId(String repaymentTaskId, String string);

	RepaymentTaskPOJO createNewRepaymentTaskPOJO(BigDecimal amount, String userId, String creditCardNumber, int taskType,
                                                 String description, String createTime, BigDecimal serviceCharge, BigDecimal rate, BigDecimal returnServiceCharge, String channelId, String channelTag);

	RepaymentTaskPOJO findByTaskType0AndTaskStatus0RepaymentTaskPOJO(String userId, String creditCardNumber);

	List<Object[]> findByCreateTime(String userId, String creditCardNumber, Pageable pageable);

	List<RepaymentTaskPOJO> findRepaymentTask(String userId, String creditCardNumber, String status,String type);

	List<RepaymentTaskPOJO> findByCreateTime(String userId, String creditCardNumber, String createTime);

	int findByOrderStatus1AndTaskType0Count(String userId, String creditCardNumber);

	List<Object[]> findByCreateTimeAndTaskStatus1(String userId, String creditCardNumber, Pageable pageable);

	List<Object[]> findByCreateTimeAndTaskStatus2(String userId, String creditCardNumber, Pageable pageable);

	List<Object[]> findByCreateTimeAndExecuteDate0(String userId, String creditCardNumber, Pageable pageable);

	List<Object[]> findByCreateTimeAndExecuteDate1(String userId, String creditCardNumber, Pageable pageable);

	List<RepaymentTaskPOJO> findByExecuteDate(String userId, String creditCardNumber);

	List<RepaymentTaskPOJO> findByUserId(String userId, Pageable pageable);

	List<RepaymentTaskPOJO> findTaskTypeAndTaskStatus(String userId,String creditCardNumber);

	List<RepaymentTaskPOJO> findTaskType2AndTaskStatus0RepaymentTaskPay();

	Map<String,Object> findRepaymentList(String userId, String creditCardNumber, String status, String type, String orderNo, Pageable pageable);

}
